Skip to content

Conversation

@michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Oct 7, 2025

Similar to #20581, but for type parameters and tuples types.
With this change, it looks like we have eliminated duplicate extractions of type (source) locations (I checked this for the mono repo).

DCA looks good.

@github-actions github-actions bot added the C# label Oct 7, 2025
@michaelnebel michaelnebel requested a review from hvitved October 8, 2025 08:23
@michaelnebel michaelnebel marked this pull request as ready for review October 8, 2025 08:23
@michaelnebel michaelnebel requested a review from a team as a code owner October 8, 2025 08:23
Copilot AI review requested due to automatic review settings October 8, 2025 08:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the extraction of location information for type parameters and tuple types in the C# extractor by reducing duplicate extractions when types are declared across multiple files. The change introduces a new GetLocations method that respects extraction context and filters locations appropriately.

  • Adds context-aware location filtering for type parameters and tuple types
  • Updates test cases to verify the improved location extraction behavior
  • Consolidates location extraction logic to prevent duplicate extractions

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Context.cs Adds new GetLocations method that filters symbol locations based on context
TypeParameter.cs Updates to use the new context-aware location extraction method
TupleType.cs Updates to use the new context-aware location extraction method
locations.ql Adds new test queries and filtering condition for type parameter and tuple type locations
Multiple1.cs Adds test cases with generic classes and tuple types
Multiple2.cs Adds test cases with generic classes and tuple types
Base.cs Adds additional generic class for testing
locations.expected Updated expected test results reflecting the optimized location extraction
2025-10-08-entity-locations.md Documents the performance optimization change

@michaelnebel michaelnebel merged commit 4cc6a07 into github:main Oct 8, 2025
22 checks passed
@michaelnebel michaelnebel deleted the csharp/reducetypeparameterandtuplelocations branch October 8, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants